package util;

import util.*;

public class Matrici {
	public boolean simmetrica(double[][] m1) {
		if (m1.length != m1[0].length)
			throw new IllegalArgumentException();

		for (int i = 0; i < m1.length; i++) {
			for (int j = 0; j < i; j++) {
				if (i != j)
					if (Mat.sufficientementeProssimi(m1[i][j], m1[j][i]))

						return false;

			}

		}
		return true;
	}

	public double[][] moltiplica(double[][] m1, double[][] m2) {

		if (m1.length != m2.length || m1[0].length != m2[0].length)
			throw new IllegalArgumentException();
		double[][] ris = new double[m1.length][m1[0].length];

		for (int i = 0; i < m1.length; i++) {
			for (int j = 0; j < m1[0].length; j++) {
				ris [i][j]=m1[i][j]*m2[i][j];

			}
		}
		return ris;
	}
}
